Answer:

' Program to convert pounds sterling to dollars.
' First the user is asked for the number of dollars per pound.
' Then the program starts looping until the user hits CONTROL-BREAK.
'
PRINT "Enter number of dollars per pound"
INPUT RATE
DO
  PRINT "Enter price in pounds"
  INPUT PRICE
  PRINT "Price in dollars:", PRICE * RATE
LOOP
END

Pitch Pipe Program

Here is a QBasic command that makes the computer play a musical note of a certain pitch for a certain length of time:

SOUND frequency,duration

In this statement,

Here is a program that plays "standard A" for about one second:

' Play Standard A for about one second
SOUND 440,18
END

(If you are in a public place you might not want to run this program.) Also, some computers are better than others at playing pleasing sounds. Some can make no sounds at all.

The above program plays a note that is the standard pitch for tuning pianos and other instruments. It is the "A" that is roughly in the middle of a piano keyboard. The "440" means that the piano string goes back and fourth 440 times per second. The "18" means the sound is played for 18 clock ticks, about one second.

It would be nice to let the user type in the frequency of the note. That way the program could be used to tune guitars or other instruments that need different notes.

QUESTION 22:

Write a program, based on the above program, that asks the user for a frequency, reads the number the user types into a variable FREQ, then SOUNDs the note for 18 clock ticks.